package com.ruoyi.wms.domain.dto;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 减少商品库存响应DTO
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
@ApiModel("减少商品库存响应")
public class InventoryDecreaseResponse
{
    /** 操作前总库存数量 */
    @ApiModelProperty(value = "操作前总库存数量", example = "100.00")
    private BigDecimal beforeTotalQty;

    /** 减少数量 */
    @ApiModelProperty(value = "减少数量", example = "50.00")
    private BigDecimal decreaseQty;

    /** 操作后总库存数量 */
    @ApiModelProperty(value = "操作后总库存数量", example = "50.00")
    private BigDecimal afterTotalQty;

    /** 操作时间 */
    @ApiModelProperty(value = "操作时间")
    private Date operationTime;

    /** 操作日志ID列表 */
    @ApiModelProperty(value = "操作日志ID列表")
    private List<Long> logIds;

    /** 受影响的库存记录数量 */
    @ApiModelProperty(value = "受影响的库存记录数量", example = "3")
    private Integer affectedRecords;

    /** 扣减详情列表 */
    @ApiModelProperty(value = "扣减详情列表")
    private List<DecreaseDetail> decreaseDetails;

    /**
     * 扣减详情内部类
     */
    @ApiModel("扣减详情")
    public static class DecreaseDetail {
        /** 库存ID */
        @ApiModelProperty(value = "库存ID", example = "1001")
        private Long inventoryId;

        /** 库位ID */
        @ApiModelProperty(value = "库位ID", example = "4001")
        private Long locationId;

        /** 批次号 */
        @ApiModelProperty(value = "批次号", example = "BATCH20240101001")
        private String batchNo;

        /** 容器号 */
        @ApiModelProperty(value = "容器号", example = "CONTAINER20240101001")
        private String containerNo;

        /** 操作前数量 */
        @ApiModelProperty(value = "操作前数量", example = "30.00")
        private BigDecimal beforeQty;

        /** 扣减数量 */
        @ApiModelProperty(value = "扣减数量", example = "20.00")
        private BigDecimal decreasedQty;

        /** 操作后数量 */
        @ApiModelProperty(value = "操作后数量", example = "10.00")
        private BigDecimal afterQty;

        /** 操作日志ID */
        @ApiModelProperty(value = "操作日志ID", example = "2001")
        private Long logId;

        // 构造函数
        public DecreaseDetail() {}

        public DecreaseDetail(Long inventoryId, Long locationId, String batchNo, String containerNo,
                            BigDecimal beforeQty, BigDecimal decreasedQty, BigDecimal afterQty, Long logId) {
            this.inventoryId = inventoryId;
            this.locationId = locationId;
            this.batchNo = batchNo;
            this.containerNo = containerNo;
            this.beforeQty = beforeQty;
            this.decreasedQty = decreasedQty;
            this.afterQty = afterQty;
            this.logId = logId;
        }

        // Getter and Setter methods
        public Long getInventoryId() {
            return inventoryId;
        }

        public void setInventoryId(Long inventoryId) {
            this.inventoryId = inventoryId;
        }

        public Long getLocationId() {
            return locationId;
        }

        public void setLocationId(Long locationId) {
            this.locationId = locationId;
        }

        public String getBatchNo() {
            return batchNo;
        }

        public void setBatchNo(String batchNo) {
            this.batchNo = batchNo;
        }

        public String getContainerNo() {
            return containerNo;
        }

        public void setContainerNo(String containerNo) {
            this.containerNo = containerNo;
        }

        public BigDecimal getBeforeQty() {
            return beforeQty;
        }

        public void setBeforeQty(BigDecimal beforeQty) {
            this.beforeQty = beforeQty;
        }

        public BigDecimal getDecreasedQty() {
            return decreasedQty;
        }

        public void setDecreasedQty(BigDecimal decreasedQty) {
            this.decreasedQty = decreasedQty;
        }

        public BigDecimal getAfterQty() {
            return afterQty;
        }

        public void setAfterQty(BigDecimal afterQty) {
            this.afterQty = afterQty;
        }

        public Long getLogId() {
            return logId;
        }

        public void setLogId(Long logId) {
            this.logId = logId;
        }
    }

    // 构造函数
    public InventoryDecreaseResponse() {}

    public InventoryDecreaseResponse(BigDecimal beforeTotalQty, BigDecimal decreaseQty, BigDecimal afterTotalQty) {
        this.beforeTotalQty = beforeTotalQty;
        this.decreaseQty = decreaseQty;
        this.afterTotalQty = afterTotalQty;
        this.operationTime = new Date();
    }

    // Getter and Setter methods
    public BigDecimal getBeforeTotalQty() {
        return beforeTotalQty;
    }

    public void setBeforeTotalQty(BigDecimal beforeTotalQty) {
        this.beforeTotalQty = beforeTotalQty;
    }

    public BigDecimal getDecreaseQty() {
        return decreaseQty;
    }

    public void setDecreaseQty(BigDecimal decreaseQty) {
        this.decreaseQty = decreaseQty;
    }

    public BigDecimal getAfterTotalQty() {
        return afterTotalQty;
    }

    public void setAfterTotalQty(BigDecimal afterTotalQty) {
        this.afterTotalQty = afterTotalQty;
    }

    public Date getOperationTime() {
        return operationTime;
    }

    public void setOperationTime(Date operationTime) {
        this.operationTime = operationTime;
    }

    public List<Long> getLogIds() {
        return logIds;
    }

    public void setLogIds(List<Long> logIds) {
        this.logIds = logIds;
    }

    public Integer getAffectedRecords() {
        return affectedRecords;
    }

    public void setAffectedRecords(Integer affectedRecords) {
        this.affectedRecords = affectedRecords;
    }

    public List<DecreaseDetail> getDecreaseDetails() {
        return decreaseDetails;
    }

    public void setDecreaseDetails(List<DecreaseDetail> decreaseDetails) {
        this.decreaseDetails = decreaseDetails;
    }

    @Override
    public String toString() {
        return "InventoryDecreaseResponse{" +
                "beforeTotalQty=" + beforeTotalQty +
                ", decreaseQty=" + decreaseQty +
                ", afterTotalQty=" + afterTotalQty +
                ", operationTime=" + operationTime +
                ", logIds=" + logIds +
                ", affectedRecords=" + affectedRecords +
                ", decreaseDetails=" + decreaseDetails +
                '}';
    }
}